package com.dashu.park.result;

import java.util.List;

/**
 * 返回T类型的集合 eg. {"code":1,"message":"SUCCESS","data":[{"id":2000,"name":"admin"},{"id":2001,"name":"test"}]}
 */
public class   ResultData<T> {

    private Integer code;//-1失败1成功
    private String message;//失败信息
    private List<T> data = null;//数据

    public ResultData(Integer code, String message, List<T> data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "ResultData{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
